/*
 * 项目名称:    wms-server-jeecg
 * 创建人员:    DongPeng
 * 创建时间:    2023-12-05
 * copyright(c) 2022 无锡星智数服科技有限公司
 */
package org.jeecg.modules.business.job;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.job.service.CheckService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 检查基础数据使用状态定时任务
 *
 * @author DongPeng
 * @version 1.0.0
 * @date 2023-12-05
 * @description 类描述
 */
@Service
@Slf4j
@RequiredArgsConstructor
public class CheckUsedJob implements Job {

    private final CheckService checkService;

    @Override
    @Async
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("开始更新基础数据已使用信息");
        long start = System.currentTimeMillis();
        checkService.checkUsed();
        long end = System.currentTimeMillis();
        log.info("结束更新 ---------> 总耗时为: " + (end-start) + "毫秒");
    }

}
